<template>
  <div>
    <div v-if="props.res">
      <nut-swiper
        :height="res.data.height + 'px'"
        :pagination-visible="true"
        :auto-play="
          res.data.autoPlay == undefined ? 5000 : res.data.autoPlay * 1000
        "
      >
        <nut-swiper-item
          w-full
          v-for="(item, index) in props.res.data.list"
          :key="item.id"
          @click="clickSwiper(index)"
        >
          <img
            w-full
            :style="{
              height: res.data.height + 'px',
              'border-radius': res.data.round + 'px'
            }"
            :src="item.img"
            alt=""
          />
        </nut-swiper-item>
      </nut-swiper>
    </div>
  </div>
</template>

<script setup lang="ts">
import { px2rpx } from './px2rpx'
import { modelNavigateTo } from './tpl-v3'
const props = defineProps(['res'])
console.log('轮播数据', props.res)
function clickSwiper(index: number) {
  modelNavigateTo(props.res.data.list[index])
}
</script>

<style scoped></style>
